
local alien = require 'alien'
local config = require 'config'


module (...)


local gint = "int"
local guint = "uint"
local gboolean = "int"
local gpointer = "pointer"

local lib = alien.load(config.libglib_path)

free = lib.g_free
free:types{ ret="void"; "pointer" }

GSourceFunc_types = { ret=gboolean; gpointer --[[data]] }
GDestroyNotify_types = { ret=void; gpointer --[[data]] }

timeout_add = lib.g_timeout_add
timeout_add:types{ ret=guint; guint --[[interval]], "callback" --[[GSourceFunc]], gpointer --[[data]] }

timeout_add_full = lib.g_timeout_add_full
timeout_add_full:types{ ret=guint;
  gint --[[priority]], guint --[[interval]], "callback" --[[GSourceFunc]], gpointer --[[data]], "callback" --[[GDestroyNotify]] }
  